package fr.expdev.bndd.action;

import fr.expdev.bndd.R;
import android.content.Context;
import android.view.animation.AnimationUtils;
import android.widget.ViewFlipper;

public class NextFlipperAction implements Action {
	
	private ViewFlipper viewFlipper;
	private Context context;
	
	public NextFlipperAction(Context context, ViewFlipper viewFlipper) {
		this.context = context;
		this.viewFlipper = viewFlipper;
	}

	@Override
	public void execute(Object... objects) {
		viewFlipper.setInAnimation(AnimationUtils.loadAnimation(context, R.anim.right_in));
		viewFlipper.setOutAnimation(AnimationUtils.loadAnimation(context, R.anim.left_out));
		viewFlipper.showNext();
	}

}
